<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2024/2/2 0002
 * Time: 10:44
 */

namespace app\index\validate;


use think\Validate;

class Member extends Validate
{
    protected $rule = [
        'group_id' => 'require',
        'username' => 'require|min:5',
        'password' => 'require|min:5',
        'rpassword' => 'require|confirm:password'
    ];

    protected $message = [
        'group_id.require' => '所属分组必须',
        'username.require' => '账号必须',
        'username.min' => '账号最少不能少于5个字符',
        'password.require' => '密码必须',
        'password.min' => '密码最少不能少于5个字符',
        'rpassword.require' => '重复密码必须',
        'rpassword.confirm' => '两次密码不一致'
    ];

    protected $scene = [
        'login' => ['username', 'password'],
        'add' => ['group_id', 'username', 'password', 'rpassword'],
        'edit' => ['group_id', 'username']
    ];
}